/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.pb138.mathml_canonicalizator;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

/**
 *
 * @author Richard
 */
public class MsqrtTransformer implements Transformer {
    
    private Node root;
    // private static final String configFile = "src/mfrac.properties";

    public MsqrtTransformer(String tagName, Map<String,String> attrs,
            Map<String, List<String>> properties) {
        
        List<String> attr_keep = properties.get("attr_keep") != null ?
                properties.get("attr_keep") : new ArrayList<String>();
        
        // removes all attributes that should be removed
        Util.removeAtrributes(attrs, attr_keep);
        
        root = new NodeImpl(tagName, attrs);
    }

    @Override
    public void addChild(Node n) {
        if (n.getTagName().equals("mrow")) {
            n.setShadow(true);
        }
        root.addChild(n);
    }

    @Override
    public void setTextContent(String s) {
    }

    @Override
    public Node transform() {
        return root;
    }
}
